import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routers'
import * as middlewareList from "./hook";


Vue.use(VueRouter)



const router = new VueRouter({
  mode: process.env.NODE_ENV === 'dev'?'history':'hash',
  base: process.env.BASE_URL,
  routes
});
Object.values(middlewareList).forEach((fn) => router.beforeEach(fn));


export default router
